package com.youku.plugins.commonui.view
{
   import flash.display.Sprite;
   import flash.text.TextField;
   import com.youku.utils.DrawUtil;
   import flash.text.TextFormat;
   
   public class PostVideoScreen extends Sprite
   {
      
      public function PostVideoScreen() {
         super();
         this.init();
      }
      
      private var _background:Sprite;
      
      private var _text:TextField;
      
      private var _width:Number;
      
      private var _height:Number;
      
      private function init() : void {
         this._background = DrawUtil.RectangleSprite(0,0,100,100,0,1,null,0);
         this._text = new TextField();
         this._text.defaultTextFormat = new TextFormat(null,30,16777215,true);
         this._text.width = 400;
         this._text.height = 200;
         this._text.autoSize = "left";
         this._text.text = "POST VIDEO SCREEN";
         addChild(this._background);
         this._background.addChild(this._text);
      }
      
      public function setSize(param1:Number, param2:Number) : void {
         this._width = param1;
         this._height = param2;
         this._background.width = this._width;
         this._background.height = this._height;
         this.updateLayout();
      }
      
      protected function updateLayout() : void {
         this._background.x = this._background.y = 0;
         this._text.x = this._background.x + (this._background.width - this._text.textWidth) / 2;
         this._text.y = this._background.y + (this._background.height - this._text.textHeight) / 2;
      }
   }
}
